/* Copyright (c) 2009 - 2010 98Labs Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.sbal89.map.model;

import java.io.Serializable;

public class Document implements Serializable {
	private static final long serialVersionUID = -8659231396443691721L;
	private String userid;
	private String title;
	private String key;
	private String type;
	private String resourceId;
	private String link;
	
	/**
	 * @return the link
	 */
	public String getLink() {
		return link;
	}
	
	/**
	 * @param link the link to set
	 */
	public void setLink(String link) {
		this.link = link;
		this.resourceId = link.substring(39);
	}
	
	/**
	 * @return the resourceId
	 */
	public String getResourceId() {
		return resourceId;
	}
	
	/**
	 * @param resourceId the resourceId to set
	 */
	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}
	
	/**
	 * @return the userid
	 */
	public String getUserid() {
		return userid;
	}
	
	/**
	 * @param userid the userid to set
	 */
	public void setUserid(String userid) {
		this.userid = userid;
	}
	
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}
	
	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	
	/**
	 * @return the key
	 */
	public String getKey() {
		return key;
	}
	
	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}
	
	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}
	
	public String getTypeStr() {
		String str="";
		if (this.type.equals("PR")) {
			str = "Presidential";
		} else if (this.type.equals("VP")) {
			str = "Vice-Presidential";
		} else if (this.type.equals("SN")) {
			str = "Senatorial";
		} else if (this.type.equals("PL")) {
			str = "Party-List";
		} else {
			str = "Transmission";
		}
		return str;
	}
	
	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}
	
}
